//
//  LZMyFastButton.m
//  DoctorFAQs
//
//  Created by langZai on 2017/2/22.
//  Copyright © 2017年 zjq. All rights reserved.
//

#import "LZMyFastButton.h"

@interface LZMyFastButton ()
/** imageView */
@property (nonatomic, strong) UIImageView *fastImageView;
/** label */
@property (nonatomic, strong) UILabel *fastTitleLabel;

@end

@implementation LZMyFastButton

- (instancetype)initWithImage:(UIImage *)iconImage WithTitle:(NSString *)title
{
    if (self = [super init]) {
//        self.imageView.image = iconImage;
//        self.titleLabel.text = title;
        _fastImageView = [[UIImageView alloc] init];
        _fastTitleLabel = [[UILabel alloc] init];
        [self addSubview:_fastImageView];
        [self addSubview:_fastTitleLabel];
        [_fastImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.height.offset(40*xsIZE);
            make.centerX.equalTo(self);
            make.top.equalTo(self);
        }];
        
        [_fastTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self);
            make.top.equalTo(_fastImageView.mas_bottom).offset(10);
        }];
        
        self.fastImageView.image = iconImage;
        self.fastTitleLabel.text = title;
        self.fastTitleLabel.textColor = KHColorFromRGB(0x8dc81b);
        self.fastTitleLabel.font = NEWFONT(15);
        
    }
    return self;
}



//- (void)layoutSubviews {
//    [super layoutSubviews];
//    self.imageView.frame = CGRectMake(0, 0, 40*xsIZE, 40*ysIZE);
//    self.titleLabel.frame = CGRectMake(0, 45*ysIZE, 40*xsIZE, 15*ysIZE);
//}


@end
